﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace d39
{
    public partial class PlayerList : GridControl
    {
        protected override void UpdateFromGrid(bool playersOrMovesChanged, bool wallTerrainChanged)
        {
            if (playersOrMovesChanged)
            {
                UpdatePanel.Update();
                Players.DataSource = CurrentGrid.RevealedPlayers;
                DataBind();                           
            }
        }
        protected IEnumerable<PositionMove> GetRevealedPositions(object player)
        {
            var p = (Player)player;
            return p.GetRevealedPositionsActiveFirst(CurrentGrid);
        }
        protected string DistUnit
        {
            get { return CurrentGrid.DnDVersion == DnDVersion.V40 ? "sq" : "ft"; }
        }
    }
}